/* where masses are stored (in a STL linked list), added, removed, updated, and accessed */

#ifndef UNIVERSE_H
#define UNIVERSE_H

#include <list>

//#include "MassObject.h"
#include "CircleMass.h"

namespace ms {
	class Universe
	{
		public:
			Universe();
			void update(double timeScale_ = .000001); // itterates through each mass and runs it's update function

			//void add(MassObject massobj); // add massobj to the STL list
			CircleMass * addCircleMass(real x_ = 0, real y_ = 0, real radius_ = 1, real mass_ = 1, real vx = 0, real vy = 0);
			// create a CircleMass with the given attributes and add it to the masterList

			void setTimeScale(double timeScale_);
			double getTimeScale();

			void setPaused(bool p);
			bool getPaused();

			void setCollision(bool c);
			bool getCollision();

			std::list<CircleMass> * getMasterListPtr(); // returns a pointer to masterList
		private:
			bool paused; // is the simulation paused?
			bool collision; // is collision detection enabled?
			std::list<CircleMass> masterList; // holds pointers to every mass
			std::list<CircleMass>::iterator i; // used to iterate through masterList

			double timeScale; // determines the speed of calculations (different for each computer)
	};
}

#endif
